﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using LPrisaMVC.Entities;
using LPrisaMVC.WebMVC4;
using LPrisaMVC.DAO;

namespace LPrisaMVC.WebMVC4.Tests.Controllers
{
    [TestClass]
    public class HistorialControllerTest
    {   

        [TestMethod]
        public void AddVentaMenudeo()
        {
            HistorialVentaDAO historialDAO = new HistorialVentaDAO();
            
            var ListEsperado = (List<HISTORIAL_VENTAS>)historialDAO.GetAllFromHistorialVentas();
            HISTORIAL_VENTAS historial = new HISTORIAL_VENTAS()
            {
                Cantidad = 50,
                Menudeo =  true,
                Fecha = DateTime.Now,
                Precio = 5,
                ProductoId = 2739,
                Total = 50, 
            };
            historialDAO.AddHistorialVentas(historial);
            var ListaCTUAL = (List<HISTORIAL_VENTAS>)historialDAO.GetAllFromHistorialVentas();
            Assert.AreEqual(ListEsperado.Count + 1, ListaCTUAL.Count, "Error ");
        }


    }
}
